package com.deliinsns.sys.filter;
import java.io.IOException;
import java.util.Enumeration;
import java.util.Properties;
import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
public class VisitFilter implements Filter {

	public void destroy(){}
	public void doFilter(ServletRequest request, ServletResponse response,
			FilterChain filterChain) throws IOException, ServletException {
		   	HttpServletRequest req = (HttpServletRequest) request;
	        HttpServletResponse res = (HttpServletResponse)response;
	        String url=req.getRequestURI();
//	        if(url.endsWith("login.jsp")){
//	        	filterChain.doFilter(req, res);
//	        	System.out.println("访问了login.jsp 文件！");
//	        }
//	        else 
//	        {
//	        	User user=(User)req.getSession().getAttribute("user");
//	        	if( null == user)//当前登录系统的用户
//	        		res.sendRedirect("login.jsp");
//	        	else
//	        	{
//	        		filterChain.doFilter(req, res);
//	        	}
//	        }
	        filterChain.doFilter(req, res);
	}

	public void init(FilterConfig arg0) throws ServletException {

	}

}
